<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <select style="width:60px" multiple size="10" id="leftID">
            <option>选项A</option>
            <option>选项B</option>
            <option>选项C</option>
            <option>选项D</option>
            <option>选项E</option>
        </select>
    </div>
    <div style="position:absolute;left:100px;top:60px">
        <input type="button" value="批量右移" id="rightMoveID" />
    </div>
    <div style="position:absolute;left:100px;top:90px">
          <input type="button" value="全部右移" id="rightMoveAllID" />
    </div>
    <div style="position:absolute;left:100px;top:120px">
        <input type="button" value="批量左移" id="leftMoveID" />
    </div>
    <div style="position:absolute;left:100px;top:150px">
          <input type="button" value="全部左移" id="leftMoveAllID" />
    </div>
    <div style="position:absolute;left:220px;top:20px">
          <select multiple size="10" style="width:60px" id="rightID"></select>
    </div>
    </body>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script type="text/javascript">
    $(function(){
        $("#leftID").dblclick(function() {
        var $option = $("#leftID option:selected");
        $("#rightID").append($option);
    });
      $("#rightMoveID").click(function() {
        var $option = $("#leftID option:selected");
        $("#rightID").append($option);
    });
     $("#rightMoveAllID").click(function() {
        var $option = $("#leftID option");
        $("#rightID").append($option);
    });

        $("#rightID").dblclick(function() {
            var $option = $("#rightID option:selected");
            $("#leftID").append($option);
        });
          $("#leftMoveID").click(function() {
            var $option = $("#rightID option:selected");
            $("#leftID").append($option);
        });
        $("#leftMoveAllID").click(function() {
        var $option = $("#rightID option");
        $("#leftID").append($option);
    });
         
    })
    </script>
    
</html>